package com.example.newnoke.ui;

import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.view.View;

import com.example.newnoke.R;
import com.example.newnoke.databinding.ActivityYejiBinding;
import com.example.newnoke.mvp.presenter.TestPresenter;
import com.example.newnoke.mvp.view.ITestV;
import com.geya.jbase.baseactivity.BaseDetailsActivity;

public class YeJiActivity extends BaseDetailsActivity<TestPresenter> implements ITestV {

    private ActivityYejiBinding mBinding;

    @Override
    public TestPresenter newPresenter() {
        return new TestPresenter(this);
    }


    @Override
    public void init() {
        mTitleButton.setTitles("我的业绩");

        mBinding.tv.setText("我的业绩：￥" + getIntent().getStringExtra("price"));
        mBinding.tv1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(YeJiActivity.this, TeamActivity.class)
                        .putExtra("name", "一级")
                        .putExtra("type", "1")
                );
            }
        });
        mBinding.tv2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(YeJiActivity.this, TeamActivity.class)
                        .putExtra("name", "二级")
                        .putExtra("type", "2")
                );
            }
        });
        mBinding.tv3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(new Intent(YeJiActivity.this, TeamActivity.class)
                        .putExtra("name", "其他")
                        .putExtra("type", "0")

                );
            }
        });
    }

    @Override
    public void setContentView() {

        mBinding = DataBindingUtil.setContentView(this, R.layout.activity_yeji);
    }
}
